import React, { Component } from 'react'
import axios from '../search/components/Search/node_modules/axios'

export default class App extends Component {

  getSutudentsData = ()=>{
    axios.get("http://localhost:3000/api1/students").then(res=>{
      console.log(res);
    }).catch(err=>{
      console.log(err);
    })
  }
  getCarsData = ()=>{
    axios.get("http://localhost:3000/api2/cars").then(res=>{
      console.log(res);
    }).catch(err=>{
      console.log(err);
    })
  }
  render() {
    return (
      <div>
        <button onClick={this.getSutudentsData}>点我获取学生数据</button>
        <button onClick={this.getCarsData}>点我获取车辆数据</button>
      </div>
    )
  }
}
